package com.tcl.aota.admin.dto;

import org.apache.commons.lang.StringUtils;

import java.util.HashMap;
import java.util.Map;

/**
 * @author kelong
 * @date 11/4/14
 */
public class AppParamDTO {
    private String appName;
    private String appOsVersion;
    private Integer sourceChannel;
    private Integer releaseStatus;
    private String appCuReference;
    private String label;
    private String uploadTime;
    private Integer trash;

    public String getAppName() {
        return appName;
    }

    public void setAppName(String appName) {
        this.appName = appName;
    }

    public String getAppOsVersion() {
        return appOsVersion;
    }

    public void setAppOsVersion(String appOsVersion) {
        this.appOsVersion = appOsVersion;
    }

    public Integer getSourceChannel() {
        return sourceChannel;
    }

    public void setSourceChannel(Integer sourceChannel) {
        this.sourceChannel = sourceChannel;
    }

    public Integer getReleaseStatus() {
        return releaseStatus;
    }

    public void setReleaseStatus(Integer releaseStatus) {
        this.releaseStatus = releaseStatus;
    }

    public String getAppCuReference() {
        return appCuReference;
    }

    public void setAppCuReference(String appCuReference) {
        this.appCuReference = appCuReference;
    }

    public String getUploadTime() {
        return uploadTime;
    }

    public void setUploadTime(String uploadTime) {
        this.uploadTime = uploadTime;
    }

    public Integer getTrash() {
        return trash;
    }

    public void setTrash(Integer trash) {
        this.trash = trash;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public Map<String, Object> putCondsMap() {
        Map<String, Object> param = new HashMap<String, Object>();
        if (!StringUtils.isEmpty(appName)) {
            param.put("appName", appName);
        }
        if (!StringUtils.isEmpty(appOsVersion)) {
            param.put("appOsVersion", appOsVersion);
        }
        if (sourceChannel != null) {
            param.put("sourceChannel", sourceChannel);
        }
        if (releaseStatus != null) {
            param.put("releaseStatus", releaseStatus);
        }
        if (!StringUtils.isEmpty(appCuReference)) {
            param.put("appCuReference", appCuReference);
        }
        if (!StringUtils.isEmpty(uploadTime)) {
            param.put("uploadTime", uploadTime);
        }
        if (trash != null) {
            param.put("trash", trash);
        }
        if (label != null) {
            param.put("label", label);
        }
        return param;
    }
}
